﻿using System;

namespace WF_AppFuel.Validation.Base
{
    /// <summary>
    /// Base class to which all validation attribute implementations extends to.
    /// </summary>
    /// <author>Arjay C. Nacion</author>
    [AttributeUsage(AttributeTargets.Property)]
    public abstract class BaseValidationAttribute : Attribute, IValidationAttribute
    {
        private string validationMessage;

        public abstract Type ValidationEngineType { get; }

        /// <summary>
        /// Gets the validation message associated with this attribute.
        /// </summary>
        public string ValidationMessage
        {
            get { return this.validationMessage; }
        }

        /*
         * Sets the validation message for this attribute.
         */
        protected void SetValidationMessage(string validationMessage)
        {
            this.validationMessage = validationMessage;
        }
    }
}
